package com.zgm.ch04._2_2_2;

import java.io.BufferedInputStream;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;

public class DestructiveBeanDemo {

	public static void main(String[] args) throws Exception{
		XmlBeanFactory beanFactory = new XmlBeanFactory(new ClassPathResource("com/zgm/ch04/_2_2_2/_2_2_2-context.xml"));
		System.out.println(beanFactory.getBean("destructBean"));
		
		beanFactory.destroySingletons();
		System.out.println("全部销毁！");
		new BufferedInputStream(System.in).read();
	}
}
